package com.jxau.mall.demo.config;

import com.jxau.mall.demo.entity.Dog;
import com.jxau.mall.demo.entity.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @BelongsProject: shop
 * @Belongspackage: com.jxau.mall.demo.config
 * @Author: guojiani
 * @CreateTime: 2025-03-29 21:00
 * @Description: TODO
 * @Version: 1.0
 */
@Configuration //说明这是一个配置类(容器)，可在这里面创建对象
public class ContainerConfig {
    @Bean //将返回值对象放到容器中
    //相当于Dog dog = new Dog();
    public Dog dog(){
        return new Dog();
    }

    @Bean(value = "p")
    //相当于Person p = new Person()
    public Person person(){
        return new Person();
    }
}
